function launchProgram(extensionIndex, programIndex, file, remoteFile) {
try {
if (file) { // do remote edit
var path = gRemotePath.value;
var origFile = { lastModifiedTime: file.lastModifiedTime };
var tmpDir = Components.classes["@mozilla.org/file/directory_service;1"].createInstance(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsILocalFile);
var intervalId;
var uploadId;
var uploadCallback;
var func = function () {
if (!file.exists()) {
clearInterval(intervalId);
return;
}
if (file.lastModifiedTime != origFile.lastModifiedTime) {
if (uploadId) { // if we have an upload currently in progress/in queue cancel it
queueTree.cancel([{ id: uploadId }]);
if (uploadCallback) {
uploadCallback();
}
uploadId = null;
uploadCallback = null;
}
var count = 1; // XXX createUnique doesn't seem to work for some reason, have to do what it does manually
var tmpFile = Components.classes["@mozilla.org/file/directory_service;1"].createInstance(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsILocalFile);
function remoteLaunchProgram(extensionIndex, programIndex, fileIndex) {
if (!gFtp.isConnected || !isReady()) {
return;
}
try {
var count = 0;
for (var x = 0; x < remoteTree.rowCount; ++x) {
if (remoteTree.selection.isSelected(x)) {
++count;
let tmpFile = Components.classes["@mozilla.org/file/directory_service;1"].createInstance(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsILocalFile);